package zzhyc.keystore.sigmob

import android.content.Intent
import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import com.sigmob.windad.WindAdOptions
import com.sigmob.windad.WindAds
import zzhyc.keystore.R

private const val TAG = "SigmobActivity"

class SigmobActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_sigmob)
        initSdk()
    }

    private fun initSdk() {
        val windAds = WindAds.sharedAds()
        windAds.isDebugEnable = true
        WindAds.requestPermission(this)
        val options =
            windAds.startWithOptions(
                this, WindAdOptions(SigmobKey.SIGMOB_APP_ID, SigmobKey.SIGMOB_APP_KEY)
            )
        if (options) {
            Log.i(TAG, "sigmob初始化成功")
            startActivity(Intent(this, SigmobSplashActivity::class.java))
        }
    }
}